package ZhuJei.ZiDingYi02;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class AnnoDemo {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class aClass = Class.forName("ZhuJei.ZiDingYi02.UseTest");
        UseTest useTest =(UseTest) aClass.newInstance();
        Method[] method = aClass.getDeclaredMethods();
        for (Method method1 : method) {
            if (method1.isAnnotationPresent(Test.class)){
                method1.invoke(useTest);
            }
        }
    }
}
